import puppeteer from "../../../lib/puppeteer/puppeteer.js";
import moment from "moment";

export class sponsor extends plugin {
  constructor() {
    super({
      name: "sponsor",
      dsc: "sponsor",
      event: "message",
      priority: -1314520,
      rule: [
        {reg: "^#?(我要|我想)?(赞助|资助)$", fnc: "赞助"},
			]
		});
	}
	
async 赞助(e){
    let path = process.cwd()
    let time = moment().format('YYYY-MM-DD HH:mm:ss')
    e.reply(await puppeteer.screenshot('sponsor', {
      tplFile: './plugins/sponsor/resources/sponsor/index.html',
      pluResPath: `${path}/plugins/sponsor/resources/sponsor/`,
      quality: 200,
      time
    }))
  }
}
